<!DOCTYPE html>
<html>
<head>
  <?php
    // Creating the doc title
    thematic_doctitle();

    // Creating the content type
    thematic_create_contenttype();

    // Creating the description
    thematic_show_description();

    // Creating the robots tags
    thematic_show_robots();

    // Creating the canonical URL
    thematic_canonical_url();

    // Loading the stylesheet
    thematic_create_stylesheet();

    // Calling WordPress' header action hook
    wp_head();
  ?>
  <script src="<?php bloginfo('template_directory'); ?>/js/jquery.min.js" type="text/javascript"></script>
  <script src="<?php bloginfo('template_directory'); ?>/js/jquery.nivo.slider.pack.js" type="text/javascript"></script>
  <link REL="SHORTCUT ICON" HREF="<?php bloginfo('template_directory'); ?>/images/favicon.ico">
</head>

<script type="text/javascript">
  $(window).load(function() {
      $('#slider').nivoSlider();
  });
</script>

<script>
  $(document).ready(function(){
    $("ul.child-list > li.cat-item a").each(function(){
      var link = $(this).attr("href");
      var img = $(this).find("img").attr('src');
      var tmp = $(this).text();

      if(img){
        $(this).replaceWith('<a href="'+link+'"><div><img src="'+img+'" class="category_icon" alt="'+tmp+'" /><p>'+tmp+'</p></div></a>');
      }else{
        $(this).replaceWith('<a href="'+link+'"><div class="show"><p>'+tmp+'</p></div></a>');
      }
    });

    /*gallery child*/
    $("li.menu-item-object-category a").attr('href', '#');
    $("li.current-cat").parent().css("display", "block");

     $("li#menu-item-15 a").click(function(){
      $('ul.child-list').css('display', 'none');
      $("li.menu-item-object-category").removeClass("category-hover");

      $("li#menu-item-15").toggleClass("category-hover");
      $("ul#child-gallery").slideToggle('fast');
     });

     /*blog child*/
     $("li#menu-item-14 a").click(function(){
      $('ul.child-list').css('display', 'none');
      $("li.menu-item-object-category").removeClass("category-hover");

      $("li#menu-item-14").toggleClass("category-hover");
      $("ul#child-blog").slideToggle('fast');
     });

     /*blog info*/
     $("li#menu-item-18 a").click(function(){
      $('ul.child-list').css('display', 'none');
      $("li.menu-item-object-category").removeClass("category-hover");

      $("li#menu-item-18").toggleClass("category-hover");
      $("ul#child-info").slideToggle('fast');
     });
  });
</script>

<body>
  <div id="wrapper" class="container_10">
    <div id="header" class="grid_10">
      <?php wp_nav_menu(array('menu=Main Menu')); ?>

        <ul id="child-gallery" class="child-list">
       <?php wp_list_categories('orderby=id&use_desc_for_title=1&child_of=4&title_li=&hide_empty=0'); ?>
       </ul>

       <ul id="child-blog" class="child-list">
       <?php wp_list_categories('orderby=id&use_desc_for_title=1&child_of=1&title_li=&hide_empty=0'); ?>
       </ul>

       <ul id="child-info" class="child-list">
       <?php //wp_list_categories('orderby=id&use_desc_for_title=1&child_of=9&title_li=&hide_empty=0');
        $args = array( 'category' => 9 );
        $all_posts = get_posts($args);

        foreach($all_posts as $t_post){
       ?>
        <li>
          <a href="<?php echo get_permalink($t_post->ID); ?>">
            <div class="show">
              <p><?php echo $t_post->post_title; ?></p>
            </div>
          </a>
        </li>
       <?php } ?>
       </ul>
    </div>

    <img src="<?php bloginfo('template_directory'); ?>/images/logo.png" class="logo-bg">

